package com.mapforge.map.tools;

import java.awt.Point;

import com.mapforge.listener.RenderListener;
import com.mapforge.map.TileMap;

/**
 * The {@link MapToolInterface} interface provides common behavior for classes
 * which manipulate {@link TileMap tile maps} through mouse input. Examples
 * include altering the content of a map's layers, or altering a map's scale.
 * 
 * @author Will Morrison
 * @since 0.1
 * @version 1.0
 */
public interface MapToolInterface {
	public boolean addRenderListener(RenderListener listener);

	public boolean removeRenderListener(RenderListener listener);

	/**
	 * Called when a manipulation, or series of manipulations, is beginning on a
	 * {@link TileMap TileMap.} This function shall be called before
	 * {@link #performEdit()}.
	 */
	public void beginEdit();

	/**
	 * Manipulates a {@link TileMap} in some way. This function is called each
	 * time a drag action occurs into a new tile.
	 */
	public void performEdit();

	/**
	 * Called when a manipulation, or series of manipulations on a
	 * {@link TileMap} are complete. This function shall be called after
	 * {@link #performEdit()} the final time.
	 */
	public void endEdit();

	/**
	 * Returns whether this {@link MapToolInterface} is currently performing an
	 * edit.
	 * 
	 * @return whether this {@link MapToolInterface} is performing an edit.
	 */
	public boolean isEditing();

	public void setAnchorPoint(Point startPoint);

	public Point getAnchorPoint();

	public void setMovingPoint(Point currentPoint);

	public Point getMovingPoint();

	/**
	 * Returns the {@link TileMap} this {@link MapToolInterface} is
	 * manipulating.
	 * 
	 * @return {@link TileMap} being manipulated
	 */
	public TileMap getTileMap();

	public void setTileMap(TileMap tileMap);

	public String getDescription();
}
